DRAGONCOLOR_TO_ACES_2065_1 = np.array(
[[0.532279, 0.376648, 0.091073],
[0.046344, 0.974513, -0.020860],
[-0.053976, -0.000320, 1.054267]])
DRAGONCOLOR2_TO_ACES_2065_1 = np.array(
[[0.468452, 0.331484, 0.200064],
[0.040787, 0.857658, 0.101553],
[-0.047504, -0.000282, 1.047756]])
REDCOLOR_TO_ACES_2065_1 = np.array(
[[0.451464, 0.388498, 0.160038],
[0.062716, 0.866790, 0.070491],
[-0.017541, 0.086921, 0.930590]])
REDCOLOR2_TO_ACES_2065_1 = np.array(
[[0.480997, 0.402289, 0.116714],
[-0.004938, 1.000154, 0.004781],
[-0.105257, 0.025320, 1.079907]])
REDCOLOR3_TO_ACES_2065_1 = np.array(
[[0.512136, 0.360370, 0.127494],
[0.070377, 0.903884, 0.025737],
[-0.020824, 0.017671, 1.003123]])
REDCOLOR4_TO_ACES_2065_1 = np.array(
[[0.474202, 0.333677, 0.192121],
[0.065164, 0.836932, 0.097901],
[-0.019281, 0.016362, 1.002889]])
ACES2065_1_TO_sRGB = np.array(
[[2.5217167, -1.1341655, -0.3875512],
[-0.276476, 1.3727113, -0.0962348],
[-0.015382, -0.1529940, 1.1683768]])
RED_TO_ACES_2065_1_MATRICES = {
'DRAGONcolor': DRAGONCOLOR_TO_ACES_2065_1,
'DRAGONcolor2': DRAGONCOLOR2_TO_ACES_2065_1,
'REDcolor': REDCOLOR_TO_ACES_2065_1,
'REDcolor2': REDCOLOR2_TO_ACES_2065_1,
'REDcolor3': REDCOLOR3_TO_ACES_2065_1,
'REDcolor4': REDCOLOR4_TO_ACES_2065_1}
def RGB_to_RGB_matrix_to_normalised_primary_matrix(RGB_to_RGB_matrix,
XYZ_to_RGB_matrix):
M = np.einsum('...ij,...jk->...ik', XYZ_to_RGB_matrix, np.identity(3))
M = np.einsum('...ij,...jk->...ik', RGB_to_RGB_matrix, M)
M = np.linalg.inv(M)
return M
def RED_colourspaces_derivation():
RED_colourspaces = {}
for name, RGB_to_RGB_matrix in RED_TO_ACES_2065_1_MATRICES.items():
NPM = RGB_to_RGB_matrix_to_normalised_primary_matrix(
np.linalg.inv(RGB_to_RGB_matrix),
colour.RGB_COLOURSPACES['ACES2065-1'].XYZ_to_RGB_matrix)
P, W = colour.primaries_whitepoint(NPM)
RED_colourspaces[name] = colour.RGB_Colourspace(
name,
primaries=P,
whitepoint=W,
illuminant='D60',
RGB_to_XYZ_matrix=NPM,
XYZ_to_RGB_matrix=np.linalg.inv(NPM))
return RED_colourspaces
RED_COLOURSPACES = RED_colourspaces_derivation()
colour.RGB_COLOURSPACES.update(RED_COLOURSPACES)
# Computing a derived *sRGB* colourspace as methodology
# validation. Notice that the derived primaries are not exactly
# the same, which is likely to be the result of the input
# matrices being rounded and chromatic adaptation precision.
NPM = RGB_to_RGB_matrix_to_normalised_primary_matrix(
ACES2065_1_TO_sRGB,
colour.RGB_COLOURSPACES['ACES2065-1'].XYZ_to_RGB_matrix)
P, W = colour.primaries_whitepoint(NPM)
colour.RGB_COLOURSPACES['sRGB Derived'] = colour.RGB_Colourspace(
'sRGB Derived',
primaries=P,
whitepoint=W)
RGB_colourspaces_CIE_1931_chromaticity_diagram_plot(
['sRGB', 'sRGB Derived'] + sorted(RED_COLOURSPACES.keys()))